/*
 * @Descripttion: 
 * @Author: Silence
 * @Date: 2023-06-08 22:55:41
 * @LastEditors: Silence
 * @LastEditTime: 2023-06-12 09:36:01
 */
import request from '@/utils/request.js'
export const getrolesApi = () => {
  return request.get('/roles')
}
export const addrolesApi = (data) => {
  return request.post('/roles', data)
}
export const editrolesApi = (obj) => {
  return request.put('/roles/' + obj.id, { roleName: obj.roleName, roleDesc: obj.roleDesc })
}
export const delrolesApi = (roleId, perId) => {
  return request.delete(`/roles/${roleId}/rights/${perId}`)
}
export const delroleApi = (roleId) => {
  return request.delete('/roles/' + roleId)
}
export const getroleslistApi = () => {
  return request.get('/rights/tree')
}
export const getrightlistApi = () => {
  return request.get('/rights/list')
}
export const changerightlistApi = (id, rids) => {
  return request.post(`/roles/${id}/rights`, { rids })
}
